package com.pearadmin.modules.sys.service.impl;


import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pearadmin.common.web.domain.request.PageDomain;
import com.pearadmin.modules.sys.domain.WorkOperateAnode;
import com.pearadmin.modules.sys.mapper.WorkOperateAnodeMapper;
import com.pearadmin.modules.sys.service.IWorkOperateAnodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 阳极工作信息Service业务层处理
 *
 * @author Mr.Ling
 * @date 2021-12-14
 */
@Service
public class WorkOperateAnodeServiceImpl implements IWorkOperateAnodeService {
    @Autowired
    private WorkOperateAnodeMapper workOperateAnodeMapper;

    /**
     * 查询阳极工作信息
     *
     * @param id 阳极工作信息ID
     * @return 阳极工作信息
     */
    @Override
    public WorkOperateAnode selectWorkOperateAnodeById(String id) {
        return workOperateAnodeMapper.selectWorkOperateAnodeById(id);
    }

    /**
     * 查询阳极工作信息列表
     *
     * @param workOperateAnode 阳极工作信息
     * @return 阳极工作信息
     */
    @Override
    public List<WorkOperateAnode> selectWorkOperateAnodeList(WorkOperateAnode workOperateAnode) {
        return workOperateAnodeMapper.selectWorkOperateAnodeList(workOperateAnode);
    }

    /**
     * 查询阳极工作信息
     * @param workOperateAnode 阳极工作信息
     * @param pageDomain
     * @return 阳极工作信息 分页集合
     * */
    @Override
    public PageInfo<WorkOperateAnode> selectWorkOperateAnodePage(WorkOperateAnode workOperateAnode, PageDomain pageDomain) {
        PageHelper.startPage(pageDomain.getPage(), pageDomain.getLimit());
        List<WorkOperateAnode> data = workOperateAnodeMapper.selectWorkOperateAnodeList(workOperateAnode);
        return new PageInfo<>(data);
    }

    /**
     * 新增阳极工作信息
     *
     * @param workOperateAnode 阳极工作信息
     * @return 结果
     */

    @Override
    public int insertWorkOperateAnode(WorkOperateAnode workOperateAnode) {
        return workOperateAnodeMapper.insertWorkOperateAnode(workOperateAnode);
    }

    /**
     * 修改阳极工作信息
     *
     * @param workOperateAnode 阳极工作信息
     * @return 结果
     */
    @Override
    public int updateWorkOperateAnode(WorkOperateAnode workOperateAnode) {
        return workOperateAnodeMapper.updateWorkOperateAnode(workOperateAnode);
    }

    /**
     * 删除阳极工作信息对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWorkOperateAnodeByIds(String[] ids) {
        return workOperateAnodeMapper.deleteWorkOperateAnodeByIds(ids);
    }

    /**
     * 删除阳极工作信息信息
     *
     * @param id 阳极工作信息ID
     * @return 结果
     */
    @Override
    public int deleteWorkOperateAnodeById(String id) {
        return workOperateAnodeMapper.deleteWorkOperateAnodeById(id);
    }

    @Override
    public WorkOperateAnode findOperateAnodeByAnodeCode(String anodeCode) {
        return workOperateAnodeMapper.findOperateAnodeByAnodeCode(anodeCode);
    }

    @Override
    public WorkOperateAnode findByParams(Map map) {
        return workOperateAnodeMapper.findByParams(map);
    }



    @Override
    public WorkOperateAnode findBySlotAndPole(Map map) {
        return workOperateAnodeMapper.findBySlotPole(map);
    }

    @Override
    public WorkOperateAnode findByCode(Map map) {
        return  workOperateAnodeMapper.findByCode(map);
    }

}
